<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
    <head>
        <th:block th:include="include::header('事故上报')" />
    </head>
    <style type="text/css">
        #febs-accidentReport .febs-edit-area {
            font-size: 15px;
        }
    </style>
    <body class="febs-container" id="febs-accidentReport">
        <div class="febs-body layui-fluid"  lay-title="事故上报">
            <div class="febs-body-search">
                <form class="layui-form layui-table-form" lay-filter="accidentReport-table-form" id="accidentReport-table-form">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <div class="layui-form-item">
                                <div class="layui-inline" id="post-tenant" th:if="${hasHeadCompanyRole }">
                                    <label class="layui-form-label layui-form-label-sm">公司名称</label>
                                    <div class="layui-input-inline" style="width:240px;">
                                        <select name="tenantSelect" id="tenantSelect" lay-search="" >
                                            <option th:each="item:${tenantList }"
                                                    th:value="${item.tenantId}" th:text="${item.tenantName}"
                                                    th:selected="${currentTenantId ==item.tenantId}">
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">事故编号</label>
                                    <div class="layui-input-inline" >
                                        <input type="text" name="accidentNo" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">事故名称</label>
                                    <div class="layui-input-inline" >
                                        <input type="text" name="accidentTitle" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label">发生时间</label>
                                    <div class="layui-input-inline" id="laydate-range">
                                        <input type="text" name="startDate" autocomplete="off" id="start-date" lay-verify="date"
                                               class="layui-input" placeholder="开始日期">
                                    </div>
                                    <div class="layui-form-mid">-</div>
                                    <div class="layui-input-inline">
                                        <input type="text" name="endDate" autocomplete="off" id="end-date" lay-verify="date"
                                               class="layui-input" placeholder="结束日期">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">事故类型</label>
                                    <div class="layui-input-inline" style="width: 240px;">
                                        <select name="accidentType" id="accidentType" lay-search="" >
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">事故等级</label>
                                    <div class="layui-input-inline" >
                                        <select name="accidentLevel" id="accidentLevel" lay-search="" >
                                        </select>
                                    </div>
                                </div>
                                <!--<div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">调查状态</label>
                                    <div class="layui-input-inline" >
                                        <select name="surveyStatus" id="surveyStatus" lay-search="" >
                                            <option value="">请选择</option>
                                            <option value="1">待指派</option>
                                            <option value="2">待调查</option>
                                            <option value="3">进行中</option>
                                            <option value="4">待审核</option>
                                            <option value="5">审核退回</option>
                                            <option value="6">完成</option>
                                        </select>
                                    </div>
                                </div>-->

                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">事故状态</label>
                                    <div class="layui-input-inline" >
                                        <select name="status" id="status" lay-search="" >
                                            <option value="">请选择</option>
                                            <option value="1">待提交</option>
                                            <option value="2">进行中(待调查指派)</option>
                                            <option value="3">进行中(待调查)</option>
                                            <option value="4">进行中(调查中)</option>
                                            <option value="5">进行中(待调查审核)</option>
                                            <option value="6">进行中(调查审核退回)</option>
                                            <option value="7">进行中(调查完成)</option>
                                            <option value="8">完成</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <div id="query" class="layui-btn search-btn">
                                        <em class="layui-icon">&#xe615;</em> 查询
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
            </form>
            </div>
            <div class="febs-table-full">
                <table lay-filter="accidentReportTable" lay-data="{id: 'accidentReportTable'}"></table>
            </div>

        </div>
        <th:block th:include="include::foot" />
        <script type="text/html" id="accidentReport-toolbar">
            <div class="jhg-body-button">
                <div lay-event="add" class="layui-btn layui-btn-sm">
                    <em class="layui-icon">&#xe654;</em> 新增
                </div>
            </div>
        </script>
        <script type="text/html" id="accidentReport-option">
            <span shiro:lacksPermission="accidentReport:update,accidentReport:delete">
            <span class="layui-badge-dot febs-bg-orange"></span> 无权限
            </span>
<!--            accident_report  status(事故上报状态) : 1：待提交 2：进行中 3：已完成-->
<!--            accident_report  survey_status(调查状态): 1:待调查指派 2：已分配待调查 3：进行中  4：调查待审核 5：调查审核退回 6：调查完成-->

            {{# if(d.status=='1'){  }}
                <button type="button" lay-event="edit" class="layui-btn layui-btn-xs  layui-btn-primary layui-border-orange" shiro:hasPermission="accidentReport:edit">
                    <em class="layui-icon layui-icon-edit"></em>编辑
                </button>
                <button type="button" lay-event="del"  class="layui-btn layui-btn-xs  layui-btn-primary layui-border-red" shiro:hasPermission="accidentReport:delete">
                    <em class="layui-icon layui-icon-delete"></em>删除
                </button>
            {{# } else {  }}
                {{# if(d.surveyStatus=='1' && d.status=='2'){  }}
                <button type="button" lay-event="survey-assign" class="layui-btn layui-btn-xs  layui-btn-primary layui-border-purple" shiro:hasPermission="accidentReport:surveyAssign">
                    <em class="layui-icon layui-icon-team"></em>调查指派
                </button>
                {{# } else {  }}
                <button type="button" class="layui-btn layui-btn-xs  layui-btn-primary layui-btn-disabled layui-border-purple" shiro:hasPermission="accidentReport:surveyAssign">
                    <em class="layui-icon layui-icon-team"></em>调查指派
                </button>
                {{# } }}

                {{# if(d.noticeChic=='0' && d.status=='3'){  }}
                <button type="button" lay-event="noticeChic" class="layui-btn layui-btn-xs  layui-btn-primary layui-border-green" shiro:hasPermission="accidentReport:noticeChic">
                    <em class="layui-icon layui-icon-totop"></em>重工上报
                </button>
                {{# } else if(d.noticeChic=='1') { }}
                <span class="layui-badge febs-bg-green">已上报重工</span>
                {{# } else { }}
                <button type="button" class="layui-btn layui-btn-xs  layui-btn-primary layui-btn-disabled layui-border-green" shiro:hasPermission="accidentReport:noticeChic">
                    <em class="layui-icon layui-icon-totop"></em>重工上报
                </button>
                {{# } }}
            {{# } }}

        </script>
        <script data-th-inline="javascript" >
            tenantId = [[${tenantId}]],
            hasHeadCompanyRole = [[${hasHeadCompanyRole}]];
            accidentTypeList = [[${accidentTypeList}]];
            accidentLevelList = [[${accidentLevelList}]];
            jobOperationList = [[${jobOperationList}]];
            reasonTypeList = [[${reasonTypeList}]];
        </script>
        <script th:src="@{/febs/js/accidentReport/accidentReportList.js(v=1)}"></script>
    </body>
</html>